@extends('admin.common.layout')
@section('admin')
<table id="appAuthTable"></table>
<div id="appAuthToolBar" style="padding:10px">
<form id="fm-app-auth" action="###" method="get">

  <label class="l-btn-disabled">&nbsp;&nbsp;名&nbsp;&nbsp;称：</label><input  class="textbox" type="text" name="name" placeholder="暂不支持..." readonly="true" style="width:150px;padding:5px;"/>
  <label class="l-btn-disabled">&nbsp;&nbsp;权&nbsp;&nbsp;限：</label><input  class="textbox" type="text" name="host" placeholder="暂不支持..." readonly="true" style="width:150px;padding:5px;"/>
  <label class="l-btn-disabled">&nbsp;&nbsp;应&nbsp;&nbsp;用：</label>
  <select class="easyui-combobox" name="app_id" style="width:150px;height:28px;">
    <option value="">请选择</option>
    @foreach($data['apps'] as $app)
     @if($data['app_id'] == $app['id'])
     <option selected="selected" value="{{$app['id']}}">{{$app['name']}}</option>
     @else
     <option value="{{$app['id']}}">{{$app['name']}}</option>
     @endif
    @endforeach
  </select>
  <label class="l-btn-disabled">&nbsp;&nbsp;状&nbsp;&nbsp;态：</label>
  <select class="easyui-combobox" name="status" style="width:150px;height:28px;">
    <option value="0">请选择</option>
    <option value="1">正常</option>
    <option value="2">禁用</option>
  </select>
  <input  class="textbox" type="hidden" name="type" value="ajax" />
  <button  type="button" class="easyui-linkbutton" iconCls="icon-search" onClick='appAuthObj.search();'>查询</button>
  <button  type="button" class="easyui-linkbutton" iconCls="icon-reload" onClick='appAuthObj.reset();'>重置</button>
  <a class="easyui-linkbutton" iconCls="icon-20130406015709810_easyicon_net_16" onClick='commonObj.reload();'>重载</a>
  <a class="easyui-linkbutton" iconCls="icon-application_osx_add" plain="false" data="{{json_encode(['id'=>0,'name'=>'顶部权限','app_id'=>$data['app_id']])}}"  onClick='appAuthObj.add(this);'>新增模块</a>
</form>
</div>
<div id="dlg-app-auth-add" class="easyui-dialog" style="width:400px" closed="true" buttons="#dlg-app-auth-add-buttons">
	<form id="fm-app-auth-add" method="get">
	<div style="margin:0;padding:20px 25px">
	<div style="margin-bottom: 10px;">
	<label class="textbox-label">应用名称：</label>
	<select id="app-auth-add-app_id" class="easyui-combobox" name="app_id" style="width:50%;">
	<option value="0">请选择应用</option>
	@foreach($data['apps'] as $app)
	<option value="{{$app['id']}}">{{ $app['name'] }}</option>
	@endforeach
	</select>
	</div>
	<div style="margin-bottom:10px">
	<label class="textbox-label">父级权限：</label>
	<input id="app-auth-add-parent_id" class="easyui-combobox" name="parent_id">
	</div>
    <div style="margin-bottom:10px">
	<input  name="name" class="easyui-textbox"  required="true" label="权限名称:" style="width:90%">
	</div>
	<div style="margin-bottom:10px">
	<input  name="uri" class="easyui-textbox" label="权限路由:" style="width:90%">
	</div>
	<div style="margin-bottom:10px">
	<input name="css" class="easyui-textbox" label="权限样式:" style="width:90%">
	</div>
	<div style="margin-bottom:10px">
	<input  name="weight" class="easyui-textbox" style="text-align:center;" label="权限权重:" style="width:50%">
	</div>
	<div style="margin-bottom:10px">
	<input  name="desc" class="easyui-textbox" required="true" multiline=true label="权限描述:" style="width:90%;height:50px;">
	</div>
	<!-- <div style="margin-bottom:10px">
	<input name="app_id"  class="easyui-textbox"  label="应用ID:" style="width:90%">
	</div>
	<div style="margin-bottom:10px">
	<input  name="parent_id" class="easyui-textbox"  label="父级权限:" style="width:90%">
	</div> -->
	</div>
	</form>
</div>
<div id="dlg-app-auth-add-buttons">
<a class="easyui-linkbutton" iconCls="icon-page_save" onclick="appAuthObj.save(this);">保存数据</a>
<a class="easyui-linkbutton" iconCls="icon-page_cancel" onclick="appAuthObj.cancel(this);">放弃操作</a>
</div>

<div id="dlg-app-auth-edit" class="easyui-dialog" style="width:400px" closed="true" buttons="#dlg-app-auth-edit-buttons">
  <form id="fm-app-auth-edit" method="get">
   <div style="margin:0;padding:20px 25px">
	<div style="margin-bottom:10px;display:none;">
	<input type="hidden" id="app-auth-edit-id" name="id" class="easyui-textbox" abel="权限ID:" style="width:90%">
	</div>
	<div style="margin-bottom:10px;display:none;">
	<input type="hidden" id="app-auth-edit-is_show" name="is_show" class="easyui-textbox" label="权限状态:" style="width:90%">
	</div>
	<div style="margin-bottom:10px;display:none;">
	<input type="hidden" id="app-auth-edit-status" name="status" class="easyui-textbox" label="权限状态:" style="width:90%">
	</div>
	<div style="margin-bottom: 10px;">
	<label class="textbox-label">应用名称：</label>
	<select id="app-auth-edit-app_id" class="easyui-combobox" name="app_id" style="width:50%;">
	<option value="">请选择应用</option>
	@foreach($data['apps'] as $app)
	<option value="{{$app['id']}}">{{ $app['name'] }}</option>
	@endforeach
	</select>
	</div>
	<div style="margin-bottom:10px">
	<label class="textbox-label">父级权限：</label>
	<input id="app-auth-edit-parent_id" name="parent_id">
	</div>
	<div style="margin-bottom:10px">
	<input id="app-auth-edit-name" name="name" class="easyui-textbox"  required="true" label="权限名称:" style="width:90%">
	</div>
	<div style="margin-bottom:10px">
	<input id="app-auth-edit-uri" name="uri" class="easyui-textbox" label="权限路由:" style="width:90%">
	</div>
	<div style="margin-bottom:10px">
	<input id="app-auth-edit-css" name="css" class="easyui-textbox" label="权限样式:" style="width:90%">
	</div>
	<div style="margin-bottom:10px">
	<input id="app-auth-edit-weight"  name="weight" class="easyui-textbox" style="text-align:center;" label="权限权重:" style="width:50%">
	</div>
	<div style="margin-bottom:10px">
	<input id="app-auth-edit-desc" name="desc" class="easyui-textbox" required="true" multiline=true label="权限描述:" style="width:90%;height:50px;">
	</div>
   </div>
  </form>
</div>
<div id="dlg-app-auth-edit-buttons">
<a class="easyui-linkbutton" iconCls="icon-page_save" onclick="appAuthObj.modify(this);">保存数据</a>
<a class="easyui-linkbutton" iconCls="icon-page_cancel" onclick="appAuthObj.cancel(this);">放弃操作</a>
</div>
<script>
require(['pages/admin/app/app','pages/common/common'],function(appAuth,common){
common.init({});
appAuth.appAuthInit({
get_list_url:"{{ route('admin.app.auth')}}",
get_add_url:"{{ route('admin.app.auth.add')}}",
get_edit_url:"{{ route('admin.app.auth.edit')}}",
});
});
</script>
@stop
